/* YFree */
import yFree from './YFree/YFree.js'
/* App自定义 */
import Global from './Global.js'
import Pagination from "./views/Pagination.vue";
import Float from "./views/Float.vue";
import Search from "./views/Search.vue";
import Upload from "./views/Upload.vue";

/* 三方 */
import 'viewerjs/dist/viewer.css'
import VueViewer from 'v-viewer'

yFree.yInit((yConfig, app) => {
    app.config.globalProperties.Global = Global;
    app.config.globalProperties.IJkid = Global.IJkid;
    app.config.globalProperties.IFinal = Global.IFinal;
    app.config.globalProperties.AppUtils = Global.AppUtils;
    app.component("my-pagination", Pagination);
    app.component("my-float", Float);
    app.component("my-search", Search);
    app.component("my-upload", Upload);
    app.use(VueViewer);

    yConfig.webName = "YShop管理后台";
    yConfig.IP = "http://192.168.1.212:11000/admin";
    yConfig.interface = "/interface";
    yConfig.onYHTTPHeader = () => {
        let userModel = Global.AppUtils.readUserModel();
        return {
            "admin-platform-version": "100",
            "admin-sign": userModel == null || userModel.sign == null ? "" : userModel.sign,
        }
    };
});
